<?php /*a:2:{s:59:"D:\phpStudy\WWW\blog\application\admin\view\cate\index.html";i:1544177012;s:48:"D:\phpStudy\WWW\blog\application\view\admin.html";i:1544171026;}*/ ?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>I Can Flay</title>
    <link rel="stylesheet" href="<?php echo asset('admin/vendors/bootstrap/css/bootstrap.css'); ?>">
    <link rel="stylesheet" href="<?php echo asset('admin/vendors/font-awesome/css/font-awesome.css'); ?>">
    <link rel="stylesheet" href="<?php echo asset('admin/vendors/nprogress/nprogress.css'); ?>">
    <link rel="stylesheet" href="<?php echo asset('admin/css/admin.css'); ?>">
    <script src="<?php echo asset('admin/vendors/nprogress/nprogress.js'); ?>"></script>
    <!--css内容-->
    
<!--<link rel="stylesheet" type="text/css" href="<?php echo asset('bootstrap-3.3.7/css/bootstrap.css'); ?>"/>-->
 
</head>
<body>
<script>NProgress.start()</script>
<div class="main">
    <nav class="navbar">
        <button class="btn btn-default navbar-btn fa fa-bars"></button>
        <ul class="nav navbar-nav navbar-right">
            <li><a href="<?php echo url('admin/index/personal'); ?>"><i class="fa fa-user"></i>个人中心</a></li>
            <li><a href="<?php echo url('admin/index/tuichu'); ?>"><i class="fa fa-sign-out"></i>退出</a></li>
        </ul>
    </nav>
    <!--内容-->

    <ul class="nav nav-tabs">
        <li role="presentation" ><a href="<?php echo url('admin/index/index'); ?>">首页</a></li>
        <li role="presentation" class="active"><a href="#">分类管理</a></li>
    </ul>
        <div class="result-wrap">
            <form name="myform" id="myform" method="post">
                <ul class="nav nav-pills">
                <li role="presentation" class="active"><a id="add" href="#">添加分类</a></li>
                <li role="presentation"><a href="#">批量删除</a></li>
            </ul>
                <div class="result-content">
                    <table class="table table-hover">
                        <tr>
                            <th class="tc" width="5%">
                                <input class="allChoose" name="" type="checkbox">
                            </th>
                            <th>ID</th>
                            <th>分类名称</th>
                            <th>分类描述</th>
                            <th>分类图片</th>
                            <th>操作</th>
                        </tr>
                        <?php foreach($date as $item): ?>
                        <tr>
                            <td class="tc">
                                <input name="id" value="<?php echo htmlentities($item['id']); ?>" type="checkbox">
                            </td>
                            <td><?php echo htmlentities($item['id']); ?></td>
                            <td ><?php echo htmlentities($item['title']); ?></td>
                            <td><?php echo htmlentities($item['content']); ?></td>
                            <td>
                                <img src="http://www.blog.com/<?php echo htmlentities($item['mylogo']); ?>" width="80px" alt="">
                            </td>
                            <td>
                                <a id="<?php echo htmlentities($item['id']); ?>" class="btn btn-info link-update" href="#">修改</a>
                                <a id="<?php echo htmlentities($item['id']); ?>" class="btn btn-danger link-del" href="#">删除</a>
                            </td>
                        </tr>
                        <?php endforeach; ?>
                    </table>
                </div>
            </form>
            <nav aria-label="Page navigation">
                <?php echo $date; ?>
            </nav>
        </div>
    
</div>
<div class="aside">
    <div class="profile">
        <img class="avatar" src="http://www.blog.com/<?php echo htmlentities($data['0']['mylogo']); ?>">
        <h3 class="name">admin</h3>
    </div>
    <ul class="nav">
        <li class="active">
            <a href="<?php echo url('admin/index/index'); ?>"><i class="fa fa-dashboard"></i>仪表盘</a>
        </li>
        <li>
            <a href="#menu-posts" class="collapsed" data-toggle="collapse">
                <i class="fa fa-thumb-tack"></i>文章<i class="fa fa-angle-right"></i>
            </a>
            <ul id="menu-posts" class="collapse">
                <li><a href="<?php echo url('admin/blog/index'); ?>">所有文章</a></li>
                <li><a href="<?php echo url('admin/blog/blogadd'); ?>">写文章</a></li>
                <li><a href="<?php echo url('admin/cate/index'); ?>">分类目录</a></li>
            </ul>
        </li>
        <li>
            <a href="<?php echo url('admin/discuss/index'); ?>"><i class="fa fa-comments"></i>评论</a>
        </li>
    </ul>
</div>
</body>

<!--js内容-->
<script src="<?php echo asset('admin/vendors/jquery/jquery.js'); ?>"></script>
<script src="<?php echo asset('admin/vendors/bootstrap/js/bootstrap.js'); ?>"></script>
<script src="<?php echo asset('layer/layer.js'); ?>"></script>
<script>NProgress.done()</script>

<script>
    $(function(){
        $('#add').click(function(){
            layer.ready(function(){
                layer.open({
                    //弹出框样式
                    type:2,
                    //弹出框标题
                    title:'添加分类',
                    //是否全屏
                    maxmin:true,
                    //弹出框大小
                    area:['1000px','600px'],
                    content:"<?php echo url('admin/cate/cateadd'); ?>"
                })
            });
        });
        $('.link-update').click(function(){
            var id =$(this).attr('id');
            layer.ready(function(){
                layer.open({
                    type:2,
                    maxmin:true,
                    title:'修改分类',
                    area:['1000px','600px'],
                    content:"<?php echo url('admin/cate/cateupd?id='); ?>"+id
                })
            })
        })
        $('.link-del').click(function(){
            var id =$(this).attr('id');
            $.ajax({
                url:"<?php echo url('admin/cate/catedel'); ?>",
                type:'get',
                data:{id:id},
                dataType:'json',
                success:function(msg){
                    if(msg==1){
                        layer.alert('删除成功',{icon:6},function(){
                            parent.location.reload();
                            window.location.href="<?php echo url('admin/cate/index'); ?>";
                        })
                    }else{
                        layer.alert('删除失败',{icon:5})
                    }
                }
            })
        })
    })
</script>

</html>